package com.FSS.FileList;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import com.FSS.Query.SearchCondition;

public abstract class IBox extends FileList {

	/**
	 * 
	 */
	private static final long serialVersionUID = -345851263143047214L;
	protected String boxName;
	public void addChild(IBox b){}
	public void removeChild(IBox b){}
	public abstract void rar();
	public String getBoxName() {
		return boxName;
	}
	public void setBoxName(String boxName) {
		this.boxName = boxName;
	}
	public void streamHandle(Process p) throws IOException{
		InputStream is = p.getInputStream();
		BufferedReader br = new BufferedReader(new InputStreamReader(is));
		StringBuilder buf = new StringBuilder();
		String line = null;
		while ((line = br.readLine()) != null)
			buf.append(line);
		System.out.println(buf);
	}
	public boolean equals(Object o){
		if (!(o instanceof SearchCondition))
			return false;
		if (this == o)
			return true;
		IBox ib = (IBox)o;
		return ib.boxName.equals(this.boxName);	
	}
	public int hashCode(){
		int result = 17;
		result = result*37+boxName.hashCode();
		return result;
	}
}
